Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gc: make it safer by only activating by use of certain flags #3363

Merged
merged 2 commits into from
Feb 21, 2020

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Feb 19, 2020

Previous plain gc is now not supported. The same behavior can be trigger by
gc -w or gc --workspace. When --all-{tags, commits, branches} are
specified, it will work as if -w is also specified (same as before).

  • ❗ Have you followed the guidelines in the Contributing to DVC list?

  • 📖 Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.

iterative/dvc.org#1013

  • ❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

Related to #2325

dvc/repo/gc.py Outdated Show resolved Hide resolved
@@ -47,6 +56,7 @@ def run(self):
force=self.args.force,
jobs=self.args.jobs,
repos=self.args.repos,
workspace=self.args.workspace,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general thought, not about this PR, - we should stop automatically making command line options into boolean kwargs, e.g. using set() would be more appropriate here.

tests/func/test_gc.py Outdated Show resolved Hide resolved
tests/func/test_gc.py Outdated Show resolved Hide resolved
@skshetry skshetry force-pushed the fix-gc-defaults branch 3 times, most recently from 6408c82 to 3ff044f Compare February 20, 2020 13:45
Previous plain `gc` is now not supported. The same behavior can be trigger by
`gc -w` or `gc --workspace`. When `--all-{tags, commits, branches}` are
specified, it will work as if `-w` is also specified (same as before).
Comment on lines +10 to +11
class InvalidArgumentError(ValueError, DvcException):
"""Thrown if arguments are invalid."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Should we use it in otherplaces like dvc/repo/__init__.py and dvc/repo/reproduce.py too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd opt for it on a different PR. 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skshetry Sure, let's not forget about it though 🙂

@efiop
Copy link
Contributor

efiop commented Feb 21, 2020

@skshetry Let's not forget about docs, please :)

@skshetry
Copy link
Member Author

@efiop, I have created an issue in iterative/dvc.org#1013

Copy link
Contributor

@pared pared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants